<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>

<head lang="en">

    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="${pageContext.request.contextPath}/images/top_logo.ico">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css"  media="all">
    <link href="${pageContext.request.contextPath}/css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/head.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-theme.css">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <script src="${pageContext.request.contextPath}/dist/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/js/index.js"></script>
    <title>纳贤首页</title>

</head>
<script>
    function iframe() {
        var sms = "";//接收session中的信息
        var perName = $("#perName").val();
        console.log(perName);
        $.ajax({
            url: "${pageContext.request.contextPath}/login/index",
            type: "post",
            data: {   //数据传输到服务器

            },
            dataType: "json",

            success: function (result) {
                sms = result.data;
                console.log(sms);
                if (sms != null) {

                    perName = sms.perName;
                    console.log(perName);
                    $(".dropbtn").children(":first").children(":last-child").hide();
                    var perName1 = $(".dropbtn").append($(".dropbtn").children(":first").children(":first").text());
                    console.log(perName1);
                    perName1.text(perName)
                    // perName1.html(regist)

                } else {
                    $(".dropdown").children(":last-child").hide();
                    $(".dropdown").children(":first").children(":first").children("img").hide();
                }

            }


        })
    }

</script>

<body onload="iframe()">

<jsp:include page="../head.jsp"></jsp:include>


<div class="main" >
    <!-- 搜索框-->
    <div class="contain-header" >
        <div class="search-wrapper">
            <div id="search_box" class="search_box" data-lg-tj-track-code="index_search" data-lg-tj-track-type="1">
                <form id="searchForm" class="searchForm clearfix" name="searchForm" action="" method="get">
                    <span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
                    <input type="text" id="search_input" class="search_input ui-autocomplete-input" tabindex="1" maxlength="64" autocomplete="off" value="" placeholder="搜索职位" style="color: rgb(153, 153, 153);">
                    <div >
                        <button class="p_but" type="button" id="selbtn" onclick="selectkey()"     style="margin-left: 2px;margin-top: 1px; height:40px; width: 50px " value="搜索">搜索</button>

                    </div>
                </form>
                <input type="hidden" id="search_py" value="">
                <input type="hidden" id="isIndex" value="true">
                <ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" id="ui-id-1" tabindex="0" style="display: none;"></ul>
                <p class="ht" track-type="recommendKeyword" recommend-type="1">

                    热门推荐：
                    <a href=""  target="_self" style="color: rgb(255, 159, 32);" onmouseout="this.style.color='#ff9f20'" onmouseover="this.style.color='#ff6000'">纳贤招聘</a>
                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=java" id="sel" target="_self">java</a>

                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=c" id="sell" target="_self">c</a>

                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=c++" id="selll" target="_self">c++</a>

                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=Python" id="sellll" target="_self">Python</a>

                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=DBA" id="selllll" target="_self">DBA</a>

                    <a href="${pageContext.request.contextPath}/recruitList/select?selectkey=运维" id="sellllll" target="_self">运维</a>

                </p>
            </div>
        </div>
    </div>
    <!--主体部分-->
    <div class="container-body">
        <div class="clearfix">
            <!--左边-->
            <div id="sidebar" class="sidebar"  >
                <div class="mainNavs"style="height: 430px;" >
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                    Java
                                </h2>
                                <a  id="selectOne" href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=Java开发工程师" ><h3 id="selOne">Java开发工程师</h3></a>

                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                    C
                                </h2>
                                <a  id="selectTwo" href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=C语言开发工程师"><h3 id="selTwo">C语言开发工程师</h3></a>
                                <a  id="selectThree" href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=C语言工程师"><h3 id="selThree">C语言工程师</h3></a>
                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                   C++
                                </h2>
                                <a id="selectFour"href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=C++开发工程师"><h3 id="selFour">C++开发工程师</h3></a>

                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                   Python
                                </h2>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=Python工程师" id="selectFive"><h3 id="selFive">Python工程师</h3></a>
                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                    DBA
                                </h2>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=DBA工程师" id="selectSix"><h3 id="selSix">DBA工程师</h3></a>

                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                   移动开发
                                </h2>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=移动开发工程师" id="selectSeven"><h3 id="selSeven">移动开发工程师</h3></a>

                                <i class="arrow"></i>
                            </div>
                        </div>

                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                    测试
                                </h2>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=测试工程师" id="selectEight"><h3 id="selEight">测试工程师</h3></a>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=软件测试工程师" id="selectNine"><h3 id="selNine">软件测试工程师</h3></a>
                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                    <div class="menu_box">
                        <div class="menu_main job_hopping">
                            <div class="category-list">
                                <h2>
                                运维
                                </h2>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=系统运维工程师" id="selectTen"><h3 id="selTen">系统运维工程师</h3></a>
                                <a href="${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName=运维工程师"id="selectEleven"><h3 id="selEleven">运维工程师</h3></a>
                                <i class="arrow"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--右边-->
            <div class="layui-carousel" id="test10" style="height: 430px">

                <div carousel-item="" id="banner" >
                    <div><img src="${pageContext.request.contextPath}/images/bg_01.JPG " style="width: 778px;height: 440px;"></div>
                    <div><img src="${pageContext.request.contextPath}/images/bg_02.JPG "style="width: 778px;height: 440px;"></div>
                    <div><img src="${pageContext.request.contextPath}/images/bg_03.JPG "style="width: 778px;height: 440px;"></div>
                    <div><img src="${pageContext.request.contextPath}/images/bg_04.JPG "style="width: 778px;height: 440px;"></div>

                </div>
            </div>
            <!--工作详情-->
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li class="layui-this">24Hour热门</li>
                    <li >最新职位</li>

                </ul>
                <!--放入工作详情-->
                <div class="layui-tab-content" >
                    <div class="layui-tab-item layui-show" style="overflow:scroll;height: 420px">
                        <ul class="position_list_ul ulList LAY_demo3" id="LAY_demo2">

                        </ul>

                    </div>
                    <div class="layui-tab-item">
                        <ul class="position_list_ul LAY_demo4" >


                        </ul>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="main-bottom"></div>

</div>

<div class="bottom" style="margin-top: 30px">
    <div class="bottom1">
        <li><strong>联系方式：1383838438</strong></li>
        <li>Email：NaXian.com（公司）</li>
        <li>13843843@qq.com（个人）</li>
    </div>
    <div class="bottom2">
        <ul>
            <li><strong>简介</strong></li>
            <li> 关于我们</li>
            <li> 服务声明</li>
            <li>媒体报道</li>
            <li> Investor Relations</li>
        </ul>
    </div>
    <div class="bottom3">
        <ul>
            <li><strong>合作</strong></li>
            <li> 加入我们</li>
            <li> 联系我们</li>
            <li>友情链接</li>
        </ul>

    </div>
    <div class="bottom4">

        <ul>
            <li><strong>帮助</strong></li>
            <li> 帮助中心</li>
            <li> 常见问题</li>
            <li>新手引导</li>
        </ul>
    </div>
    <div class="bottom5">

        <ul>
            <li><strong>导航</strong></li>
            <li> 网站地图</li>
            <li> 职位搜索</li>
            <li>简历中心</li>
            <li> 企业名录</li>
        </ul>
    </div>
    <div class="bottom6">
        <img src="${pageContext.request.contextPath}/images/NaXian.png">
        <p>服务号</p>
    </div>
</div>
<%--首页跳转url--%>
<script>
$.ajax({
    type:"post",
    url:"${pageContext.request.contextPath}/index/get",
    datatype:"json",
    success:function (result) {
        var data = result.data;//indexVo
        var content ='';
        $.each(data,function (i,item) {

            console.log("============================================================"+item);
            content+='<li class="position_list_item default_list" >';
            content+='<div class="pli_top">';
            content+='<div class="clearfix pli_top_l">';
            content+='<div class="position_name fl">';
            content+='<h2 class="dib clearfix">';
            content+='<span><a id="a" class="position_link fl wordCut " href="${pageContext.request.contextPath}/search/recruit/'+item.recId+'/">'+item.recName+'</a></span>';
            content+='</h2>';
            content+='<h2 class="dib clearfix"><span class="salary fr">'+item.recJobSalary+'</span></h2>';
            content+='</div>';
            content+='</div>';
            content+='<div class="position_main_info wordCut">';
            content+='<span>工作经验'+item.recJobExperience+'+</span>';
            content+='<span>'+item.education+'</span>';
            content+='</div>';
            content+='<div class="labels">';
            content+='<div class="pli_btm_l">';
            content+='<span class="wordCut" >'+item.kwd+'</span>';
            content+='</div>';
            content+='</div>';
            content+='<div class="pli_btm clearfix">';
            content+='<a href="" class="fl" target="_blank" >';
            content+='<img class="company-logo" src="${pageContext.request.contextPath}/images/main.jpg"  style=""height="40px",width="40px">';
            content+='</a>';
            content+='<div class="bottom-right">';
            content+='<h3 class="company_name wordCut">';
            content+='<a id="b" href="${pageContext.request.contextPath}/recruit/'+item.recId+'/" target="_blank"  >'+item.companyName+'</a>';
            content+='</h3>';
            content+='<h3 class="industry wordCut">';
            content+='<span>'+item.companySize+'|</span>';
            content+='<span>'+item.companyType+'</span>';
            // content+='<span>'+item.companyAddress+'</span>';
            content+='</h3>';
            content+='</div>';
            content+='</div>';
            content+='</div>';
            content+='</li>';
            $(".LAY_demo3").append(content);
            $(".LAY_demo4").append(content);
            content='';
        })
    }
});
</script>
<%--首页搜索--%>
<script>
    function selectkey() {
        var  key = $("#search_input").val();
        var urlSrt = "${pageContext.request.contextPath}/recruitList/select?selectkey="+key;
        console.log(key);
        window.location.href = urlSrt;
    }
</script>
<script>
    var function1 = document.getElementById("sel").innerText;
    $("#sel").attr("href","${pageContext.request.contextPath}/recruitList/select?selectkey="+function1);

    var function2 = document.getElementById("sel1").innerText;
    $("#sell").attr("href","${pageContext.request.contextPath}/recruitList/select?selectkey="+function2);

    var function3 = document.getElementById("sel11").innerText;
    $("#selll").attr("href","${pageContext.request.contextPath}/recruitList/select?selectkey="+function3);

    var function4 = document.getElementById("sel111").innerText;
    $("#sellll").attr("href","${pageContext.request.contextPath}/recruitList/select?selectkey="+function4);

    var function5 = document.getElementById("sel1111").innerText;
    $("#selllll").attr("href","${pageContext.request.contextPath}/recruitList/select?selectkey="+function5);



    var jobName = document.getElementById("selOne").innerText;
    console.log("职位名称"+jobName);
    $("#selectOne").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName);
    var jobName1 = document.getElementById("selTwo").innerText;
    $("#selectTwo").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName1);
    var jobName2 = document.getElementById("selThree").innerText;
    $("#selectThree").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName2);
    var jobName3 = document.getElementById("selFour").innerText;
    $("#selectFour").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName3);
    var jobName4 = document.getElementById("selFive").innerText;
    $("#selectFive").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName4);
    var jobName5 = document.getElementById("selSix").innerText;
    $("#selectSix").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName5);
    var jobName6 = document.getElementById("selSeven").innerText;
    $("#selectSeven").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName6);
    var jobName7 = document.getElementById("selEight").innerText;
    $("#selectEight").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName7);
    var jobName8 = document.getElementById("selNine").innerText;
    $("#selectNine").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName8);
    var jobName9 = document.getElementById("selTen").innerText;
    $("#selectTen").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName9);
    var jobName10 = document.getElementById("selEleven").innerText;
    $("#selectEleven").attr("href","${pageContext.request.contextPath}/recruitList/selectByRecName?selectRecName="+jobName10);

</script>

<%--轮播图--%>
<script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('carousel', function(){
        var carousel = layui.carousel;
        //建造实例
        var ceshi = carousel.render({
            elem: '#test10'
            ,width: '778px'
            ,height: '440px'
            ,interval: 5000
        });
        ceshi.reload({
            elem: '#test10'
            ,width: '778px'
            ,height: '440px'
            ,interval: 5000
        })



        });
</script>

<script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('element', function(){
        var $ = layui.jquery
            ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

        //触发事件
        var active = {
            tabAdd: function(){
                //新增一个Tab项
                element.tabAdd('demo', {
                    title: '新选项'+ (Math.random()*1000|0) //用于演示
                    ,content: '内容'+ (Math.random()*1000|0)
                    ,id: new Date().getTime() //实际使用一般是规定好的id，这里以时间戳模拟下
                })
            }

            ,tabChange: function(){
                //切换到指定Tab项
                element.tabChange('demo', '22'); //切换到：用户管理
            }
        };

        $('.site-demo-active').on('click', function(){
            var othis = $(this), type = othis.data('type');
            active[type] ? active[type].call(this, othis) : '';
        });

        //Hash地址的定位
        var layid = location.hash.replace(/^#test=/, '');
        element.tabChange('test', layid);

        element.on('tab(test)', function(elem){
            location.hash = 'test='+ $(this).attr('lay-id');
        });

    });


</script>

<%--地址弹出层--%>
<script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('layer', function() { //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

        //触发事件
        var active = {
            setTop: function () {
                var that = this;

            }

            , notice: function () {
                //示范一个公告层
                layer.open({
                    type: 1
                    , title: false //不显示标题栏
                    , closeBtn: false
                    , area: '500px;'
                    , shade: 0.8
                    , id: 'LAY_layuipro' //设定一个id，防止重复弹出
                    , btn: ['确定', '退出']
                    , btnAlign: 'c'
                    , moveType: 1 //拖拽模式，0或者1
                    , content: '<div  class="script-address" >' +
                        ' <ul >' +
                        '<li >苏州<li/>' +
                        '<li>苏州<li/>' +
                        '<li>苏州<li/>' +
                        '<li>苏州<li/>' +
                        '<li>苏州<li/>' +
                        '</ul> ' +
                        ' <br><br>' +
                        ' <ul >' +
                        '<li >上海<li/>' +
                        '<li>上海<li/>' +
                        '<li>上海<li/>' +
                        '<li>上海<li/>' +
                        '<li>上海<li/>' +
                        '</ul> ' +
                        '<br><br>' +
                        ' <ul >' +
                        '<li >南京<li/>' +
                        '<li>南京<li/>' +
                        '<li>南京<li/>' +
                        '<li>南京<li/>' +
                        '<li>南京<li/>' +
                        '</ul> ' +
                        '<br><br>' +
                        ' <ul >' +
                        '<li >北京<li/>' +
                        '<li>北京<li/>' +
                        '<li>北京<li/>' +
                        '<li>北京<li/>' +
                        '<li>北京<li/>' +
                        '</ul> ' +
                        '<br><br>' +
                        ' <ul >' +
                        '<li >成都<li/>' +
                        '<li>成都<li/>' +
                        '<li>成都<li/>' +
                        '<li>成都<li/>' +
                        '<li>成都<li/>' +
                        '</ul> ' +
                        '</div>'
                    , success: function (layero) {
                        var btn = layero.find('.layui-layer-btn');
                        btn.find('.layui-layer-btn0').attr({
                            href: 'http://www.layui.com/'
                            , target: '_blank'
                        });
                    }
                });
            }

        };

        $('#layerDemo .layui-btn').on('click', function () {
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });


</script>
</body>
</html>
